<template>
	<view class="page">
		<CustomNav :isBack="true" color="#fff" :topBgColor="topBgColor" title="咨询电话"></CustomNav>
		<image src="https://jinta-gas-charge-1306862033.cos.ap-chengdu.myqcloud.com/uniapp/home/banner.png"
			class="bg-img" mode="widthFix"></image>
		<view class="info-block">
			<view class="info-list" v-for="item in list" :key="item.id">
				<view class="name">{{item.companyName}}</view>
				<view class="info-item">
					<view class="info" @click="call(item.companyPhone)">
						<view class="iconfont icon-a-235zuoji"></view>
						<view class="address">{{item.companyPhone}}</view>
					</view>
					<view class="text-item" @click="call(item.companyPhone)">
						<view class="iconfont icon-boda"></view>
						<view class="text">拨打</view>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import {
		validate
	} from '@/util/validate.js'
	import {
		getCompanyListApi
	} from '@/api/payment.js'
	export default {
		components: {},
		data() {
			return {
				topBgColor: 'rgba(0,0,0,0)',
				list: []
			}
		},
		watch: {

		},
		methods: {
			getList() {
				uni.showLoading({
					title: '加载中',
					mask: true
				})
				getCompanyListApi().then((res) => {
					this.list = res
				});
			},
		},
		onLoad() {
			this.getList()
		}
	}
</script>

<style lang="scss">
	.page {
		overflow: hidden;
		min-height: 100vh;
		background-color: #F4F8FF;

		.bg-img {
			width: 100%;
			height: 100%;
		}

		.info-block {
			width: calc(100% - 60rpx);
			margin: 30rpx auto;
			margin-top: -90rpx;

			.info-list {
				background: #FFFFFF;
				border-radius: 20rpx;
				padding: 30rpx;
				margin-bottom: 30rpx;

				.name {
					font-size: 32rpx;
				}

				.info-item {
					display: flex;
					align-items: center;
					justify-content: space-between;
					margin-top: 20rpx;

					.info {
						display: flex;
						align-items: center;
						justify-content: space-between;
						margin-top: 20rpx;
						width: calc(100% - 160rpx);

						.iconfont {
							color: #4072E7;
							//color: #767676;
							font-size: 34rpx;
						}

						.address {
							width: calc(100% - 40rpx);
							font-size: 28rpx;
							color: #767676;
							overflow: hidden;
							text-overflow: ellipsis;
							white-space: nowrap;
						}
					}

					.text-item {
						display: flex;
						align-items: center;
						border-radius: 60rpx;
						border: 1px solid #4072E7;
						padding: 8rpx 20rpx;

						.iconfont {
							color: #4072E7;
							font-size: 36rpx;
						}

						.text {
							color: #4072E7;
							font-size: 30rpx;
						}
					}
				}
			}
		}
	}
</style>